package food;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class MapTest extends Mapper<LongWritable, Text, food, NullWritable> {
    food k = new food();
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        String data [] = value.toString().substring(1,value.toString().length()-1).split(" ");
        k.set(data[0].substring(5),Integer.parseInt(data[1].substring(3)),Integer.parseInt(data[4]));
        context.write(k,NullWritable.get());
    }
}
